package com.aaa.doctor.service.impl;

import com.aaa.doctor.mapper.PatientFileMapper;
import com.aaa.doctor.service.PatientFileService;
import com.aaa.entity.PatientFile;
import com.aaa.vo.Result;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author MuChengGuo
 * @date 2023/3/24 17:51
 * Description: TODO
 **/
@Service
public class PatientFileServiceImpl implements PatientFileService {
    @Autowired(required = false)
    private PatientFileMapper patientFileMapper;

    /**
     * 通过 patientId 查看此患者档案信息
     *
     * @param patientId
     * @return
     */
    @Override
    public Result<PatientFile> getPatientById(String patientId) {
        QueryWrapper<PatientFile> wrapper = new QueryWrapper<>();
        wrapper.eq("patient_id", patientId);
        PatientFile patientFile = patientFileMapper.selectOne(wrapper);
        return new Result<>(2000, "通过 patientId 查看此患者档案信息成功", patientFile);
    }
}
